No, the forEach()
method does not return a new array. It simply calls a provided function on each element in the array.
const roadmaps = ['JavaScript', 'React', 'Node.js'];
roadmaps.forEach((roadmap) => {
console.log(roadmap);
});
Search
Aug 17, 2024, 1 min read
No, the forEach()
method does not return a new array. It simply calls a provided function on each element in the array.
const roadmaps = ['JavaScript', 'React', 'Node.js'];
roadmaps.forEach((roadmap) => {
console.log(roadmap);
});